import re 


def func_addr(inst_src):
    with open(inst_src, "r") as f:
        inst = f.readlines()

    with open("func_addr.txt", "w") as f:
        for i in inst:
            is_match = re.match(r"(^[0-9a-f]{16} <[0-9a-z\_]+>):$", i)
            if(is_match):
                f.write(is_match[1]+"\n")

def main():
    inst_src = "../../rt-thread/bsp/qemu-riscv-virt64/rtthread.txt"
    func_addr(inst_src)

main()